Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Token Exchange Profile #1119

Merged
merged 20 commits into from
Jan 29, 2025
Merged

Conversation

duedares-rvj
Copy link
Contributor

@duedares-rvj duedares-rvj commented Jan 14, 2025

🔧 Changes

Added new resource and data-source auth0_token_exchange_profile
Added support to set token_exchange for auth0_client resource

resource "auth0_token_exchange_profile" "my_token_exchange_profile" {
	name = "my-token-prof"
	subject_token_type = "https://acme.com/cis-token"
	action_id = auth0_action.my_action.id
	type = "custom_authentication"
}

resource "auth0_client" "my_client" {
	name = "my_client"
	app_type = "native"
	token_exchange {
		allow_any_profile_of_type = ["custom_authentication"]
	}
	mobile {
		android {
			app_package_name = "com.example"
			sha256_cert_fingerprints = ["DE:AD:BE:EF"]
		}
	}
}

📚 References

Auth0 Management API: Token Exchange Profiles Documentation
POST Token Exchange Profile
GET All Token Exchange Profiles
GET Token Exchange Profile by ID
PATCH Token Exchange Profile
DELETE Token Exchange Profile

🔬 Testing

Relevant test cases has been added:
make test-acc FILTER=TestTokenExchangeProfile

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@duedares-rvj duedares-rvj requested a review from a team as a code owner January 14, 2025 05:31
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 91.48936% with 12 lines in your changes missing coverage. Please review.

Project coverage is 89.22%. Comparing base (0e7b309) to head (3cf18c8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/auth0/tokenexchangeprofile/resource.go 84.81% 8 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1119      +/-   ##
==========================================
+ Coverage   89.20%   89.22%   +0.01%     
==========================================
  Files         130      134       +4     
  Lines       18156    18296     +140     
==========================================
+ Hits        16196    16324     +128     
- Misses       1387     1395       +8     
- Partials      573      577       +4     
Files with missing lines Coverage Δ
internal/auth0/action/resource.go 87.36% <100.00%> (+0.06%) ⬆️
internal/auth0/client/resource.go 98.52% <100.00%> (+0.01%) ⬆️
internal/auth0/tokenexchangeprofile/data_source.go 100.00% <100.00%> (ø)
internal/auth0/tokenexchangeprofile/expand.go 100.00% <100.00%> (ø)
internal/auth0/tokenexchangeprofile/flatten.go 100.00% <100.00%> (ø)
internal/provider/provider.go 100.00% <ø> (ø)
internal/auth0/tokenexchangeprofile/resource.go 84.81% <84.81%> (ø)

Copy link
Contributor

@developerkunal developerkunal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duedares-rvj added some feedback please take a look!

@@ -0,0 +1 @@
package tokenexchangeprofile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't see any test cases here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the test and the recordings

developerkunal
developerkunal previously approved these changes Jan 29, 2025
Copy link
Contributor

@developerkunal developerkunal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@duedares-rvj duedares-rvj merged commit 46d7c1f into main Jan 29, 2025
6 of 7 checks passed
@duedares-rvj duedares-rvj deleted the DXCDT-776/Token_exchange branch January 29, 2025 10:35
@@ -67,7 +67,7 @@ resource "auth0_action" "my_action" {

- `dependencies` (Block Set) List of third party npm modules, and their versions, that this action depends on. (see [below for nested schema](#nestedblock--dependencies))
- `deploy` (Boolean) Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately.
- `runtime` (String) The Node runtime. Defaults to `node18`. Possible values are: `node16` (not recommended), or `node18` (recommended).
- `runtime` (String) The Node runtime. Possible values are: `node12`, `node16` (not recommended), `node18`, `node22`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call out the current Default value for runTime

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Computed value is node22, so we should not call out a default. the default depends on the kind of trigger.

@duedares-rvj duedares-rvj mentioned this pull request Jan 29, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants